{% extends "dissemin/skeleton.html" %}

{% load leaflet_tags %}
{% load i18n %}
{% load solo_tags %}
{% load static %}
{% load widget_tweaks %}
{% load capture_tags %}

{% block headTitle %}
{% trans "Home" %}
{% endblock %}

{% block extra_head %}
{% include 'statistics/headers.html' %}
{% leaflet_js %}
{% leaflet_css %}
{% endblock %}

{% block jsScript %}
{% endblock %}

{% block content %}
<div id="fullPage">
    <h2>{% trans "Institutions" %}</h2>

    {% leaflet_map "institutions" callback="institutions_map_init" %}

    <script type="text/javascript">
        function institutions_map_init (map, options) {
	    map.setView([51.505, -0.09], 8);
            console.log('adding data');
	    var dataurl = '{% url "ajax-institutions-geojson" %}';
	    // Download GeoJSON via Ajax
	    $.getJSON(dataurl, function (data) {
		// Add GeoJSON layer
		console.log('got data back');
		L.geoJson(data).addTo(map);
	    });
        }
    </script>
</div>
{% endblock %}
